package com.xsmart.order.api;

import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.order.services.YyDetailUrlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;

/**
 * @author 周志成
 */
@Controller
@RequestMapping("/api")
public class YyDetailUrlController {
    @Autowired
    YyDetailUrlService yyDetailUrlService;

    /**
     * 查询广告推荐转入地址
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/YyDetailUrlService/queryYyDetailUrl", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean queryYyDetailUrl(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return yyDetailUrlService.queryYyDetailUrl(requestBean);
    }

    /**
     * 新增广告推荐装入地址
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/YyDetailUrlService/addYyDetailUrl", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean addShipping(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return yyDetailUrlService.addYyDetailUrl(requestBean);
    }

    /**
     * 修改广告推荐转入地址
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/YyDetailUrlService/modYyDetailUrl", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean modShipping(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return yyDetailUrlService.modYyDetailUrl(requestBean);
    }

    /**
     * 删除广告推荐转入地址
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/YyDetailUrlService/delYyDetailUrl", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean delYyDetailUrl(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return yyDetailUrlService.delYyDetailUrl(requestBean);
    }

    /**
     * 查询全部数据
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/YyDetailUrlService/queryAllYyDetailUrl", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean queryAllYyDetailUrl(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return yyDetailUrlService.queryAllYyDetailUrl(requestBean);
    }

}
